package com.gitee.minimalismstyle.fresh.common.api.annotation

import com.gitee.minimalismstyle.fresh.common.api.mvc.ControllerFeignClientsRegistrar
import org.springframework.cloud.openfeign.FeignClientsConfiguration
import org.springframework.context.annotation.Import
import kotlin.reflect.KClass

@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS)
@Import(ControllerFeignClientsRegistrar::class)
annotation class EnableControllerFeignClients(

        /**
         * Alias for the [.basePackages] attribute. Allows for more concise annotation
         * declarations e.g.: `@ComponentScan("org.my.pkg")` instead of
         * `@ComponentScan(basePackages="org.my.pkg")`.
         * @return the array of 'basePackages'.
         */
        vararg val value: String = [],

        /**
         * Base packages to scan for annotated components.
         *
         *
         * [.value] is an alias for (and mutually exclusive with) this attribute.
         *
         *
         * Use [.basePackageClasses] for a type-safe alternative to String-based
         * package names.
         * @return the array of 'basePackages'.
         */
        val basePackages: Array<String> = [],

        /**
         * Type-safe alternative to [.basePackages] for specifying the packages to
         * scan for annotated components. The package of each class specified will be scanned.
         *
         *
         * Consider creating a special no-op marker class or interface in each package that
         * serves no purpose other than being referenced by this attribute.
         * @return the array of 'basePackageClasses'.
         */
        val basePackageClasses: Array<KClass<*>> = [],

        /**
         * A custom `@Configuration` for all feign clients. Can contain override
         * `@Bean` definition for the pieces that make up the client, for instance
         * [feign.codec.Decoder], [feign.codec.Encoder], [feign.Contract].
         *
         * @see FeignClientsConfiguration for the defaults
         *
         * @return list of default configurations
         */
        val defaultConfiguration: Array<KClass<*>> = [],

        /**
         * List of classes annotated with @FeignClient. If not empty, disables classpath
         * scanning.
         * @return list of FeignClient classes
         */
        val clients: Array<KClass<*>> = []
)
